<?php
//
// +------------------------------------------------------------------------+
// | PHP Version 5.4                                                        |
// +------------------------------------------------------------------------+
// | Copyright (c) All rights reserved.                                     |
// +------------------------------------------------------------------------+
// | 世纪车来车往(北京）网络科技有限公司 版权所有！                               |
// | TEL:010-63732365  HOTLINE:400-6688-365  EMAIL:clcw@clcw.com.cn         |
// | $Revision: 1.0 $                                                       |
// +------------------------------------------------------------------------+
// | Author: xiangminghu@clcw.com.cn                                        |
// +------------------------------------------------------------------------+
//

namespace AuctionBack\Controller;

use AuctionCore\Common\AjaxPage;

/**
 * 经纪人管理
 *
 * @author Xmh
 */
class AgentController extends BaseController
{
    private $agentLogic;

    public function __construct()
    {
        parent::__construct();
        $this->agentLogic = D('Agent', 'Logic');
    }

    public function index()
    {
        $this->display();
    }

    /**
     * 经纪人列表
     */
    public function agentList()
    {
        $page = I("get.p", 1);
        $size = 10;
        $params = [];
        $params['u_id'] = I('get.u_id/d');
        $params['agent'] = I('get.agent');
        $params['superior'] = I('get.superior');
        $params['agent_type'] = I('get.agent_type');
        $params['agent_status'] = I('get.agent_status');
        $params['start_time'] = I('get.start_time');
        $params['end_time'] = I('get.end_time');
        $result = $this->agentLogic->getAgentList($page, $size, $params);

        $Page = new AjaxPage($result['total'], $size, "get_page");
        $Page->setConfig('theme', " %totalRow% %header% %nowPage%/%totalPage% 页 %first% %upPage% %prePage% %linkPage% %downPage% %nextPage% %end% %jumpform%");
        $show = $Page->show();   // 分页显示输出
        //模板赋值
        $this->assign("p", $page);
        $this->assign('page', $show);   // 赋值分页输出
        $this->assign('list', $result['list']);
        $this->display();
    }

}
